1. Field of the Invention
The invention is related to a real time data compression method and apparatus applied for a data recorder, and more particularly to a method that possesses superior data compression ability even when data is rapidly varied so that significant storage capacity is available. The compressed data is further stored with a particular format that allows the searching process for these compressed data to become much quicker.
2. Description of Related Arts
In many industrial applications, a variety of data reading must be recorded, such as the temperature reading, pressure value, flow rate or electric power reading, etc. Conventionally, all variations of these readings are stored by a data storage device and printed on paper to observe their possible varying tendency. In recent years, in accordance with the fast development of the microprocessor, a lot of electricalrecorders, also known as “paperless recorders”, are presented to replace the conventional recorders.
These paperless recorders usually utilize a memory device to store the recorded data or readings. Since the recording process usually lasts for a quite long time, the memory storage capacity is a vital important factor that must be considered. Although lots of data compression methods are applied to reduce the size of the recorded data to spare a lot of available capacity in memory, these methods still have several shortcomings that need to be solved.
For example, one kind of the fan compression methods entitled SASP2 is to examine whether a new reading is in a predetermined tolerable range. If so, the reading is ignored, otherwise the reading will be recorded. With reference to the upper line on FIG. 5, each point located on the line individually represents a sampled data point. The substantially closed fan-shaped region between two adjacent sample points represents the tolerable error range, wherein each tolerable error range is predicted based on the previous data sample point. The compression method is that if the present read data point Xi is in the tolerable range, the previous data point Xi-1 is ignored. On the contrary, if the present one exceeds the tolerable range, the previous data point is recorded. Another line segment shown in the lower part of FIG. 5 represents actual variations of a series of the read data points.
However, the data compression method is capable of providing a superior compression efficiency only when the data variation is slow. When readings are varied rapidly in a period, almost all data points during the period must be recorded its position and value, which leads to the compression becoming inefficient.
Furthermore, based on the conventional compression method, the recorded information for a data point include the sampling time, the position and the value of the data point. Based on the present computer recording format, a complete sampling time must be represented by 8 bytes. However, such a format is not only unfavorable for saving the memory capacity, but is also unsuitable to find the desired data by the searching processing.
To overcome the mentioned shortcomings, a real time compression method and apparatus for a data recorder in accordance with the present invention obviates or mitigates the aforementioned problems.